<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>投诉记录</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/page.css">
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../js/media.js"></script>
    <script src="../js/common.js"></script>
    <style>

    </style>
</head>

<body>
    <!--头部-->
    <div class="public-header flex">
        <!--<span class="public-header-left-search"></span>-->
        <span class="public-header-left-back"></span>
        <span class="public-header-center">投诉记录</span>
        <span class="public-header-right">足迹</span>
    </div>

    <!--正文-->
    <div class="buy-info-page bc-gray">
        <img :src="datas.produceHeadImage" alt="">
        <section class="s1">
            <p class="t1">{{datas.produceTitle}} </p>
            <p class="t2">
                <span>{{datas.produceAddTime}}</span>
                <em class="e1" v-if='datas.isReturn'>包退</em>
                <em class="e2" v-if='datas.isFreeShipping'>包邮</em>
                <em class="e3" v-if='datas.isIdentifiable'>可鉴定</em>
            </p>
            <p class="t3">
                <span>投诉</span>
                <em class="e3">{{datas.produceShareNum}}</em>
                <em class="e2" @click='add_Collection(this)'>{{datas.produceCollectNum}}</em>
                <em class="e1" @click='add_good_2(this)' style="color:#000">{{datas.produceGoodNum}}</em>


            </p>
            <!-- <p class="t4"><span>距离结束：</span><em>2小时37分18秒</em></p> -->
        </section>
        <section class="s2 flex">
            <img :src="datas.storeName" alt="">
            <div class="right">
                <p><span>{{datas.storeName}}</span><em>VIP<strong>{{datas.storeLevel}}</strong></em><i>已关注</i>
                    <font v-if='datas.storeAuthority'></font>
                </p>
                <p><span>联系卖家</span><i><font>{{datas.storeAmountGuaranteed}}</font>元</i><em> <font>{{datas.storeScore}}</font>4分</em></p>
            </div>
        </section>
        <!--最新成交-->
        <!-- <section class="s5">
            <p class="t1">
                <span class="t1-1">最新成交人</span>
                <span class="t1-2">更多</span>
            </p>
            <ul>
                <li class="flex red">

                    <div class="li-1">
                        <img src="../img/头像 @3x.png" alt="">
                    </div>
                    <div class="li-2">
                        <p class="li-2-1">用户名</p>
                        <p class="li-2-2">￥199</p>
                    </div>
                    <div class="li-3">
                        <br> 17-07-03 10:31:13
                    </div>
                </li>
                <li class="flex gray">

                    <div class="li-1">
                        <img src="../img/头像 @3x.png" alt="">
                    </div>
                    <div class="li-2">
                        <p class="li-2-1">用户名</p>
                        <p class="li-2-2">￥199</p>
                    </div>
                    <div class="li-3">
                        <br> 17-07-03 10:31:13
                    </div>
                </li>
            </ul>
            <em class="arrow-bottom"></em>
        </section> -->
        <!-- <section class="s6">

        </section>
        <section class="s3 flex">
            <div class="a1">
                <font>起</font><em>￥</em><i>0</i>
            </div>
            <div class="a2">
                <font>加</font><em>￥</em><i>0</i>
            </div>
            <div class="a3">
                <font>保</font><em>￥</em><i>0</i>
            </div>
            <div class="a4">
                <font>延</font><em>￥</em><i>0</i>
            </div>
            <div class="a5">
                <font>一口价</font><em>￥</em><i>0</i>
            </div>

        </section> -->
        <section class="s4">
            <p class=""><span>店铺产品</span><em>拍卖公告</em></p>
            <div>
                <ul class="clearfix">
                    <li class="" v-for='item in produce'>
                        <img :src="item.produceHeadImage" alt="" @click='click_info(this)'>
                        <p class="t1">{{item.produceTitle}}</p>
                        <p class="t2"><span>￥: <font>{{item.producePrice}}</font>起</span><em @click='add_good(this)' style="color:rgba(18,18,18,0.25)">{{item.produceGoodNum}}</em></p>
                    </li>
                    <!-- <li class="">
                        <img src="../img/配图@2x.png" alt="">
                        <p class="t1">产品名字产品名字产品</p>
                        <p class="t2"><span>￥:40.00起</span><em>141</em></p>
                    </li>
                    <li class="">
                        <img src="../img/配图@2x.png" alt="">
                        <p class="t1">产品名字产品名字产品</p>
                        <p class="t2"><span>￥:40.00起</span><em>141</em></p>
                    </li>
                    <li class="">
                        <img src="../img/配图@2x.png" alt="">
                        <p class="t1">产品名字产品名字产品</p>
                        <p class="t2"><span>￥:40.00起</span><em>141</em></p>
                    </li> -->
                </ul>
            </div>
        </section>
    </div>


    <div class="buy-footer">
        <!-- <div class="c1">
            <span>进店逛逛</span>
            <em style="background:rgba(95,49,4,1);color:#fff">立即购买</em>
        </div> -->
        <div class="c4">
            <div class="top">
                <p class="t1">
                    <span style="display:inline-block;background:url('../img/起 红@2x.png') no-repeat center;background-size:contain;width:.16rem;height:.16rem;"></span>
                    <em>￥: <font>{{datas.producePrice}}</font></em>
                </p>
                <!-- <p class="t2">
                    <span>距离结束：</span>
                    <em>2小时37分18秒</em>
                </p> -->
                <p class="t3">
                    <em class="e1" @click='add_good_2(this)' style="color:#000">{{datas.produceGoodNum}}</em>
                    <em class="e2" @click='add_Collection(this)'>{{datas.produceCollectNum}}</em>
                    <em class="e3">{{datas.produceShareNum}}</em>


                </p>
                <p class="p4">{{datas.produceTitle}} </p>
            </div>
            <div class="bottom flex">
                <span @click='join_store(this)'>进店逛逛</span>

                <em style="background:rgba(95,49,4,1);color:#fff;flex:2;" @click='click()'>立即购买</em>
                <em id="text_pay">测试支付</em>
            </div>
        </div>
    </div>

    <script src='../js/vue.js'></script>
    <script src='../js/vue-resource.min.js'></script>
    <script>
        $(function () {
            $(window).scroll(function () {
                if ($(window).scrollTop() > 50) {
                    $('.buy-footer .c4 .top').css('display', 'none')
                } else {
                    $('.buy-footer .c4 .top').css('display', 'block')
                }
            })
            let s_name = getQueryString('s_name');
            $('title').html(s_name);
            var p_id = getQueryString('p_id');

            $.ajax({
                url: base_url + 'ZITAOHUI/purchase',
                data: {
                    produceId: p_id
                },
                success: function (data) {
                    console.log(data)
                    let title = data.extend.list[0].produceTitle;
                    $('title').html(title)
                }
            })

            $('#text_pay').click(function () {
                $.ajax({
                    url: base_url + 'ZITAOHUI/wexinpay',
                    data: {
                        total_fee: 1,
                        user_id: u_id,
                        ip: '117.14.168.139',
                    },
                    success: (data) => {
                        console.log(data)
                    }
                })
            })

        })
    </script>
    <script>
        $(function () {
            var p_id = getQueryString('p_id');
            new Vue({
                el: 'body',
                data: {
                    url: base_url + 'ZITAOHUI/purchase',
                },
                ready: function () {

                    var p_id = getQueryString('p_id');
                    this.$http.get(this.url, {
                        params: {
                            produceId: p_id
                        }
                    }).then(
                        function (response) {
                            let all_data = response.data.extend.list;
                            let produce_info = response.data.extend.list2;
                            let time = all_data[0].produceAddTime;
                            let all_time = new Date(time);
                            let product_time = all_time.getMonth() + '月' + all_time.getDate() +
                                '日 ' + all_time.getHours() + ':' + all_time.getMinutes();
                            all_data[0].produceAddTime = product_time;
                            console.log(product_time)
                            this.$set('datas', all_data[0])
                            this.$set('produce', produce_info.slice(0, 4))
                            console.log(response.data.extend);

                        
                        },
                        function (response) {}
                    )
                },
                methods: {
                    click: function () {

                        window.location.href =
                            '../page/my-address.html?uid=1&produceid=1&price=100&addid=1'

                    },
   
                    click_info: function (t) {
                        console.log(t)
                        window.location.href = '../page/buy-info-page.3.html?p_id=' + t.item.produceId
                    },
            
                    add_good: function (t) {
                        console.log(t)

                        // this.$http.get(base_url + 'ZITAOHUI/goodNum', {
                        //     params: {
                        //         produceId: t.item.produceId,
                        //         user_id: 1
                        //     }
                        // }).then(
                        //     function (data) {
                        //         console.log(data)
                        //         let sun = data.data.extend;
                        //         sun = sun.haha.list;
                        //         if (sun == 1) {
                        //             t.item.produceGoodNum += 1;
                        //         } else if (sun == 2) {
                        //             alert('网络不好，请稍后再试')
                        //         } else {
                        //             alert('您已经对该商品点过赞啦')
                        //         }
                        //     }
                        // )
                    },
   
                    add_good_2: function (t) {
                        console.log(t)

                        // this.$http.get(base_url + 'ZITAOHUI/goodNum', {
                        //     params: {
                        //         produceId: p_id,
                        //         user_id: 1
                        //     }
                        // }).then(
                        //     function (data) {
                        //         console.log(data)
                        //         let sun = data.data.extend;
                        //         sun = sun.haha.list;
                        //         if (sun == 1) {
                        //             t.item.produceGoodNum += 1;
                        //         } else if (sun == 2) {
                        //             alert('网络不好，请稍后再试')
                        //         } else {
                        //             alert('您已经对该商品点过赞啦')
                        //         }
                        //     }
                        // )
                    },
                    // 添加收藏
                    add_Collection: function (t) {
                        console.log(t)
                        this.$http.get(base_url + 'ZITAOHUI/conllectionNum', {
                            params: {
                                produceId: p_id,
                                user_id: 1
                            }
                        }).then(
                            function (data) {
                                console.log(data)
                                let sun = data.data.extend;
                                sun = sun.list.conllection;
                                if (sun == 1) {
                                    t.datas.produceCollectNum += 1;
                                } else if (sun == 2) {
                                    alert('网络不好，请稍后再试')
                                } else {
                                    alert('您已经对该商品点过收藏啦')
                                }
                            }
                        )
                    },
                    join_store: function (t) {
                        console.log(t)
                        window.location.href = "../page/Shop.html?s_id=" + t.datas.storeId
                    },
                    
                }
            })
        })
    </script>



</body>

</html>